package com.xbai.goods;

import com.xbai.entity.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * @author jxbai
 * @desc MapperScan 包要注意
 * @date 2021/1/27 0027
 */
@SpringBootApplication
@EnableEurekaClient
@MapperScan(basePackages = {"com.xbai.goods.dao"})
public class GoodsApplication {

    public static void main(String[] args) {
        SpringApplication.run(GoodsApplication.class, args);
    }

    /**
     * 分布式自增长ID
     * @return {@link IdWorker}
     */
    @Bean
    public IdWorker idWorker() {
        return new IdWorker();
    }
}
